{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static "countstairs/month.css" %}" />
<p> Welcome {{user.username}} <a href = "/logout/" > Logout </a> </p>


<a href= "{% url "countstairs.views.newMonth" year month "prev" %}">&lt;&lt; Prev</a>
<a href= "{% url "countstairs.views.newMonth" year month "next" %}">Next &gt;&gt;</a>
<h4>{{ mname }} {{ year }}</h4>

<div class="month">
    <table>

    <tr>
        <td class="datenum">Sun</td>
        <td class="datenum">Mon</td>
        <td class="datenum">Tue</td>
        <td class="datenum">Wed</td>
        <td class="datenum">Thu</td>
        <td class="datenum">Fri</td>
        <td class="datenum">Sat</td>
    </tr>

    {% for week in month_days %}
        <tr>
        {% for day, steps, current in week %}

            <!-- TD style: empty | day | current; onClick handler and highlight  -->
            <td class= {% if day == 0 %}"empty"{% endif %} 
            {% if day != 0 and not current %}"day"{% endif %}
            {% if day != 0 and current %}"current"{% endif %}
            {% if day != 0 %}
                >
                <div class="datenum"> {{ day }} </div>
                <p> {{steps.total}} stairs</p>
            {% else %}
                >
                <p> </p>
            {% endif %}
            </td>
        {% endfor %}
        </tr>
    {% endfor %}
    </table>

    <div class="clear"></div>
</div>
<a href="/"> Back to home </a>